<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var m = 8000;//工资
        var sum = 0;// 总额
        for (var i = 1; i <= 50; i++) {
            m = m * 5 / 100 + m; // 下一年的涨幅+上一年的基本工资
            sum += m * 12;//每一年的总工资
            console.log(i,'年后:', m, sum)
        }
        console.log('50年后:', m, sum)
    </script>
</body>

</html>